package com.dao.hm;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import com.entity.Rivalfirm;

public interface RivalFirmDAO extends CrudRepository<Rivalfirm, Long>,JpaSpecificationExecutor<Rivalfirm>{
	@Query("from Rivalfirm d where d.chanceinfo.ciid=?1")
	public List<Rivalfirm> findSomeByCiid(Long ciid);
	
	@Query("from Rivalfirm s where s.logic=1")
	public Page<Rivalfirm> queryNoCriteria(Pageable p);
	
	@Query("from Rivalfirm s where s.logic=1 and s.company like ?1")
	public Page<Rivalfirm> queryByTheme(String company, Pageable p);
	
	@Query("from Rivalfirm s where s.logic=1 and s.ability=?1")
	public Page<Rivalfirm> queryFast(String ability, Pageable p);

}
